package cn.luyou.admin.common;

import org.springframework.stereotype.Component;

import cn.hutool.crypto.digest.BCrypt;

@Component
public class PasswordUtils {

    public String encryptPassword(String plainPassword) {
        return BCrypt.hashpw(plainPassword, BCrypt.gensalt());
    }

    public boolean checkPassword(String plainPassword, String hashedPassword) {
        return BCrypt.checkpw(plainPassword, hashedPassword);
    }
} 